1. Field of the Invention
The present invention relates to an apparatus and method for controlling a card device in accordance with an access command supplied from a host system.
2. Description of the Related Art
In recent years, various portable electronic apparatuses, such as personal computers, PDA(Personal Data Assistants)s, cameras, and cellular telephones, have been developed. In these portable electronic apparatuses, memory cards, i.e., removable storage devices of one type, are used in greater numbers. Know as memory cards are: PCMCIA cards (PC cards) and SD (Secure Digital) cards. SD cards are smaller than the PCMCIA cards.
Each SD card is a memory card device that incorporates a flash memory. It is designed to meet demands for security, large storage capacity, and high-speed operation. The SD card has a security function for protecting the copyright of contents, such as music data. The music data stored in SD card is protected from illegal copying or any other illegal conducts.
Generally, memory cards with a security function have a controller, a user data area, and a secure area. The user data area is a storage area that the user can freely access. The secure area is a storage area that is protected by the security function.
A memory card is connected to a personal computer through a memory card controller. The memory card controller receives an access command supplied from the operating system provided in the personal computer and converts the command into one or more operation commands for controlling the memory card. The memory card controller supplies the operation command or commands to the memory card. The user data area in a memory card may be seen from the operating system, as a storage device similar to a disk drive. By contrast, the secure area cannot be seen at all. The secure area can be accessed by a special application program and a special reproduction apparatus, each comprising a security mechanism.
The special application program and reproduction apparatus generate security access commands for accessing the secure area to memory card controller. The memory card controller converts each of the security access command to one or more operation commands, which are supplied to the memory card.
If the operation commands for the memory card, which are concerned with the security function, are extended or if the security access commands are changed as the application program interface (API) changes, however, it is necessary to redesign the memory card controller to accord with the extension of the operation codes or the changes in the security access commands.
There is another problem with the memory card controller. Generally, various states are defined for the memory card. The operation commands that the memory card can accept differ, from a state to a state. Therefore, the memory card controller needs to determine which state the memory card assumes at present. That is, before generating an operation command, the memory card controller must set the memory card into the very state in which the memory card can accept that operation command.